package com.lau.xml;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by liutf on 2016/5/30.
 */

public class AddressBook {
    private String name;
    private List<Person> list = new ArrayList<Person>();

    public void setName(String name) {
        this.name = name;
    }

    public void addPerson(Person p) {
        this.list.add(p);
    }


    public void print() {
        System.out.println("============now AddressBook:===============");
        System.out.println("name == " + name);
        System.out.println("List Size == " + list.size());
        System.out.println("============now Person:===============");
        for (int i = 0; i < list.size(); i++) {
            System.out.println("Person " + i);
            list.get(i).print();
        }
    }
}
